<template>
  <div>
    <input type="text" v-model.number="currentAge">
    <input type="text" placeholder="明年的年龄" v-model.number="nextAge">
  </div>
</template>

<script>
// import { get } from 'http';

export default {
    data(){
        return{
            currentAge:18,
            // nextAge:'',
        }
    },
    computed:{
    nextAge:{
        get(){
            return this.currentAge+1
        },
        set(newValue){
            console.log(newValue);
            this.currentAge=newValue-1
            
        }
    }
}
}
</script>

<style>

</style>